<?php $this->_extends('_layouts/default_layout'); ?>

<?php $this->_block('title'); ?> - Test  App client token  <?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<h1>  App client token </h1>

<fieldset >
<legend>App client token </legend>
<div>
	 应用: <b><?=$app['company']?>  <?=$app['host']?> </b> <br />
	 <p><?=$app['desc']?></p>
</div>
<?php if(isset($error)):?>
<div class="notify">
	<?php foreach($error as $e=>$v){
		switch($e){
			
			case 'sessionid':  echo '  sessionid 失效 . '; break;
			case 'app':  echo ' 应用信息错误. '; break;
			case 'seller':  echo ' 用户名 或密码输入出错 '; break;
			case 'domain':  echo ' 你的提供域名不符 '; break;
			case 'store':  echo ' 你的提供域名不符 '; break;
			case 'storeseller':  echo ' 用户名与域名不符. '; break;
		}}
	?>
</div>
<?php endif;?>
<?php if(isset($return)):?>
<!--div>
	Token 已经生成:(copy it to App client.)
	<div style=" font-size:24px; font-weight:bold">
		<?=$return['token']?>
	</div>
	过期时间 :
	<div style=" font-size:24px; font-weight:bold">
		<?=date('Y-m-d H:i:s',$token->hardexpirationtime)?>
	</div>
</div-->
<div>
Token 已经生成:
	<div>
		<input type="button" value="   关闭窗口   " onclick="window.close();" />
	</div>
</div>
<?php else:?>
<form action="" method="post">
<table>
	<tr> <th>用户名:</th> <td><input type="text" name="seller_name" value="" size="40"  /> </td> </tr>
	<tr> <th>蜜码:</th> <td><input type="password" name="password" value="" size="30"  /> </td> </tr>
	<tr> <th>Domain:</th> <td><input type="text" name="domain" value="" size="40"  /> </td> </tr>
	<tr><th></th><td> <input type="submit" value="  submit  "  /> &nbsp;&nbsp;&nbsp;&nbsp; <input type="button" value="close" onclick="window.close()"/> </td></tr>
</table>
<input type="hidden" name="sessionid" value="<?=$_ctx->sessionid?>"  />
</form>
<?php endif;?>
</fieldset>
<?php $this->_endblock('contents'); ?>
